행과 열로 구성된 표를 나타낸다. 하나의 표가 생성이 되기 위해서는 <table>
요소 하위에 최소한의 계층순으로 하나 이상의 <tr>
, <td>
요소가 존재해야 한다.
플로우 콘텐츠(flow-content)가 예상되는 위치
순서대로 선택적으로 <caption>
요소, 0
개 이상의 <colgroup>
요소, 선택적으로 <thead>
요소, 0
개 이상의 <tbody>
요소 또는 하나 이상의 <tr>
요소, 선택적으로 <tfoot>
요소, 선택적으로 스크립트 지원(script supporting) 요소
[Exposed=Window]
interface HTMLTableElement : HTMLElement {
[HTMLConstructor] constructor();
[CEReactions] attribute HTMLTableCaptionElement? caption;
HTMLTableCaptionElement createCaption();
[CEReactions] undefined deleteCaption();
[CEReactions] attribute HTMLTableSectionElement? tHead;
HTMLTableSectionElement createTHead();
[CEReactions] undefined deleteTHead();
[CEReactions] attribute HTMLTableSectionElement? tFoot;
HTMLTableSectionElement createTFoot();
[CEReactions] undefined deleteTFoot();
[SameObject] readonly attribute HTMLCollection tBodies;
HTMLTableSectionElement createTBody();
[SameObject] readonly attribute HTMLCollection rows;
HTMLTableRowElement insertRow(optional long index = -1);
[CEReactions] undefined deleteRow(long index);
// also has obsolete members
};
<table> <tr><td></td></tr> </table>
일부 글로벌 애트리뷰트는 이 요소에서 사용되지 않을 수 있다.
일부 글로벌 이벤트 핸들러는 이 요소에서 사용되지 않을 수 있다. 이벤트 등록은 자바스크립트 사용을 권장한다.